import {createStore} from 'vuex'
import user from '@/store/user'
import createPersistedstate from 'vuex-persistedstate'

export default createStore({
    //5、加载多个state文件，防止一个state文件过长
    modules: {
        user,
    },
    //6、插件
    plugins: [
        createPersistedstate({
            //数据存储方式是sessionStorage
            storage: sessionStorage,
            paths: ["user"]
        })
    ]
})
